<%@ page language="java"  pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/views/common/taglib.jsp" %>
<html>
<head>
    <title>经销商列表</title>
    <%@ include file="/WEB-INF/views/common/resource.jsp" %>
    <link rel="stylesheet" type="text/css" href="${rtx}/css/upload_style.css"/>
</head>
<body>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="form-group">
            <label class="col-sm-1">所在地区</label>
            <div class="col-sm-2">
                <select class="form-control m-b" name="area" id="area">
                    <option value="">全部</option>
                    <c:forEach items="${cityList}" var="list">
                        <option value="${list.area_no}">${list.area_name}</option>
                    </c:forEach>
                </select>
            </div>

            <label class="col-sm-1 control-label">经销商编号</label>
            <div class="col-sm-2">
                <div class="row">
                   <input type="text" id="mep_no" placeholder="经销商编号" class="form-control">
                </div>
            </div>

            <label class="col-sm-1 control-label">手机号</label>
            <div class="col-sm-2">
                <div class="row">
                    <input type="text" id="mep_mobile" placeholder="请输入手机号" class="form-control">
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="form-group">
            <label class="col-sm-1">经销商状态</label>
            <div class="col-sm-2">
                <select class="form-control m-b" name="status" id="status">
                    <option value="-2">全部</option>
                    <option value="1">合作中</option>
                    <option value="0">未绑定</option>
                    <option value="-1">已停用</option>
                </select>
            </div>

            <div class="form-group">
                <div class="col-sm-2 ">
                    <button onclick="search()" style="width: 100px;" class="btn btn-primary" type="button">搜索</button>
                </div>

                <div class="col-sm-2 ">
                    <button onclick="showImportTable()" style="width: 100px;" class="btn btn-primary" type="button">导入经销商</button>
                    <a data-toggle="modal" style="display: none" id="showImportTable" class="btn btn-primary" href="#upload-form"></a>
                </div>

                <div class="col-sm-2 ">
                    <button onclick="exportTable()" style="width: 100px; background-color: #337ab7;border-color: #2e6da4;" class="btn btn-primary"  type="button">导出经销商</button>
                </div>
            </div>

        </div>
    </div>

    <div class="ibox-content">
        <div class="row ">
            <div class="col-sm-12">
                <table id="table" ></table>
            </div>
        </div>
    </div>
</div>

<div id="modal-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-12">
                        <input id="edit-mep-id" type="hidden" class="form-control">

                        <h3 class="m-t-none m-b">编辑经销商信息</h3>
                        <div class="form-group">
                            <label>经销商名：</label>
                            <input id="edit-mep-name"  type="text" class="form-control">
                        </div>
                        <div class="form-group">
                            <label>经销商区域：</label>
                            <select class="form-control m-b" name="area" id="edit-mep-city">
                                <c:forEach items="${cityList}" var="list">
                                    <option value="${list.area_no}">${list.area_name}</option>
                                </c:forEach>
                            </select>
                        </div>

                        <div class="form-group">
                            <label>详细地址：</label>
                            <input id="edit-mep-address" type="text" class="form-control">
                        </div>

                        <div class="form-group">
                            <label>联系人：</label>
                            <input id="edit-mep-contact-name" type="text" class="form-control">
                        </div>

                        <div class="form-group">
                            <label>联系电话：</label>
                            <input id="edit-mep-mobile" type="text"  class="form-control">
                        </div>


                        <div style="text-align: center">
                            <button class="btn btn-sm btn-primary" onclick="saveEdit()"><strong>保存编辑</strong>
                            </button>

                            <button class="btn btn-sm" onclick="$('#modal-form').click()"><strong>取消编辑</strong>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="upload-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-12">
                        <input type="hidden" id="upload_file_url">
                        <h3 class="m-t-none m-b">导入经销商信息</h3>

                        <div id="container" class="form-group" style="text-align: center">
                            <label>上传文件：</label>
                            <a id="self" class="btn btn-primary" href="javascript:void(0);" >选择文件</a>
                            <span id="upload_file_name"></span>
                        </div>

                        <!--图片上传进度条-->
                        <div id="uploading" class="shareBox" style="z-index: 1000; margin-left: 31%">
                            <div class="uploading_bar" id="ossfile" style="z-index: 1000;"></div>
                        </div>

                        <div style="text-align: center">
                            <button class="btn btn-sm btn-primary" onclick="importMep()"><strong>确定导入</strong>
                            </button>
                            <a style="display: none" data-toggle="modal" id="loading" class="btn btn-sm btn-primary" href="#import-loading"></a>
                            <button class="btn btn-sm" onclick="$('#upload-form').click()"><strong>取消导入</strong>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<div id="import-loading" disabled="disabled" class="modal fade" aria-hidden="true">
    <div style="background: #777 ;height: 100% ;opacity:0.1" >
    </div>
    <div class="ibox-content" style="background: none;border-color: #777;position: fixed;margin-top: -40%;margin-left:45%; border-width: 0 0;">
        <h3 style="color: white">正在处理中...</h3>
        <div class="spiner-example">
            <div class="sk-spinner sk-spinner-three-bounce">
                <div class="sk-bounce1"></div>
                <div class="sk-bounce2"></div>
                <div class="sk-bounce3"></div>
            </div>
        </div>
    </div>
</div>
</body>
<script language="javascript" type="text/javascript" src="${rtx}/js/mep/mep_manager.js"></script>
<script language="javascript" type="text/javascript" src="${rtx}/js/plupload-2.1.2/js/plupload.full.min.js"></script>
<script language="javascript" type="text/javascript" src="${rtx}/js/upload.js"></script>
</html>
